home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_q_t
/
trem.zip
/
CHAR.C
< prev
next >
Wrap
Text File
|
1991-05-11
|
2KB
|
68 lines
/************************************************************************
*
* Copyright (c) 1991 Microsoft Corporation. All Rights Reserved.
*
*-----------------------------------------------------------------------
*
* Project: Windows Terminal Example
*
* Module: char.c
*
* Author: Bryan A. Woodruff (baw)
*
*
* Remarks: Writes a character to the comm port and
* if necessary, echos back to terminal.
*
* This module could actually perform some keyboard
* remapping, but it doesn't.
*
* Revisions:
* 01.00.000 5/11/91 baw Wrote it.
*
************************************************************************/
#include "terminal.h"
/************************************************************************
* BOOL WriteCharacter( HWND hWnd, BYTE bOut )
*
* Description:
* This simply writes a character to the port and echos it
* to the terminal screen if fLocalEcho is set. Some minor
* keyboard mapping could be performed here.
*
* Comments:
* 5/11/91 baw Wrote it.
*
************************************************************************/
BOOL WriteCharacter( HWND hWnd, BYTE bOut )
{
LOCALHANDLE hTermInfo ;
NPTERMINFO npTermInfo ;
hTermInfo = GetWindowWord( hWnd, GWW_TERMINFO ) ;
if (NULL == (npTermInfo = (NPTERMINFO) LocalLock( hTermInfo )))
return ( FALSE ) ;
if (!npTermInfo -> fConnected)
{
LocalUnlock( hTermInfo ) ;
return ( FALSE ) ;
}
WriteCommByte( hWnd, bOut ) ;
if (npTermInfo -> fLocalEcho)
WriteTerminalByte( hWnd, bOut ) ;
LocalUnlock( hTermInfo ) ;
return ( TRUE ) ;
} /* end of WriteCharacter() */
/************************************************************************
* End of File: char.c
************************************************************************/